import { createI18n } from 'vue-i18n'
import zh from '@/lang/zh/index'
import en from '@/lang/en/index'
import vi from '@/lang/vi/index'
import Cookies from 'js-cookie'

const message = {
  zh: zh,
  en: en,
  vi: vi
}
const i18n = createI18n({
  locale: Cookies.get('language') || 'zh',
  legacy: false,
  globalInjection: true, // 全局注册$t方法
  messages: message
})

export default i18n